package com.onluy.frameworkcloud.batis.holder;


import com.onluy.frameworkcloud.batis.bean.CacheBoundSql;

public abstract class BoundSqlHolder
{
    private static final ThreadLocal<CacheBoundSql> holder = new ThreadLocal();

    public static void set(CacheBoundSql boundSql) {
        if (!boundSql.equals(holder.get()))
            holder.set(boundSql);
    }

    public static CacheBoundSql get()
    {
        return (CacheBoundSql)holder.get();
    }

    public static void clear() {
        holder.remove();
    }
}